import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 登录路由
  {
    path: '/',
    name: 'Head',
    component: () => import('../views/Head/index.vue'),
    redirect:'/title',
    children: [
      {
        path: '/title',
        name: 'Title',
        component: () => import('../views/Title/index.vue')
      },
      {
        path: '/home',
        name: 'Home',
        component: () => import('../views/Home/index.vue')
      },      
      {
        path: '/qtype',
        name: 'qtype',
        component: () => import('../views/Home/components/qtype.vue')
      },
      {
        path: '/muban',
        name: 'muban',
        component: () => import('../views/Title/muban.vue')
      },
      {
        path: '/ItemManagement',
        name: 'ItemManagement',
        redirect:'/ItemManagement/danxuan',
        component: () => import('../views/ItemManagement/index.vue'),
        children:[
          {
            path:'/ItemManagement/danxuan',
            name: 'danxuan',
            component: () => import('../views/ItemManagement/components/checkbox.vue'),
          },
          {
            path:'/ItemManagement/Multiplechoice',
            name: 'Multiplechoice',
            component: () => import('../views/ItemManagement/components/Multiplechoice.vue'),
          },
          {
            path:'/ItemManagement/judge',
            name: 'judge',
            component: () => import('../views/ItemManagement/components/judge.vue'),
          },
        ]
      },
    ]
  },
  {
    path: '/Login',
    name: 'Login',
    component: () => import('../views/Login/index.vue')
  },
  {
    path: '/mock',
    name: 'mock',
    component: () => import('../views/mock/mock.vue')
  },
  {
    path: '/tintmce',
    name: 'tintmce',
    component: () => import('../views/mock/tintmce.vue')
  },
  {
    path: '/cre',
    name: 'cre',
    component: () => import('../components/checkbox.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
